/**
 * ____________________ *
 *  ____ ____ ____ _  _ *
 *  |___ [__] |--< |\/| *
 * ____________________ *
 *
 * THE CORM PROJECT
 *
 * This file may only be used in accordance with the
 * terms of the Academic Free License ("AFL") v. 3.0,
 * as published by the Open Software Initiative.  A
 * copy of this license is provided in this source
 * release, and may be viewed online at:
 *
 * (http://www.opensource.org/licenses/afl-3.0.php)
 */
package org.eremite.corm.order;

import org.eremite.corm.Archetype;
import org.eremite.corm.order.event.OrderEvent;
import org.eremite.corm.party.PartySummary;

import java.util.Date;
import java.util.Set;
import java.util.Map;

/**
 * The Order archetype represents a record of a
 * request by a buyer or a seller to supply some
 * goods or services.
 */
public class Order extends Archetype {

    public static final int INITIALIZING = 0;
    public static final int OPEN = 1;
    public static final int CLOSED = 2;
    public static final int CANCELLED = 3;

    private long ID;
    private int orderStatus;
    private Map<Integer, PartySummary> partySummaries;
    private Set<OrderLine> orderLines;
    private Set<ChargeLine> chargeLines;
    private Date dateCreated;
    private String salesChannel;
    private String termsAndConditions;
    private String deliveryInstructions;
    private Set<OrderEvent> events;
    private int orderType;

    public long getID() {
        return ID;
    }

    public void setID(long ID) {
        this.ID = ID;
    }

    public Map<Integer, PartySummary> getPartySummaries() {
        return partySummaries;
    }

    public void setPartySummaries(Map<Integer, PartySummary> partySummaries) {
        this.partySummaries = partySummaries;
    }

    public Set<OrderLine> getOrderLines() {
        return orderLines;
    }

    public void setOrderLines(Set<OrderLine> orderLines) {
        this.orderLines = orderLines;
    }

    public Set<ChargeLine> getChargeLines() {
        return chargeLines;
    }

    public void setChargeLines(Set<ChargeLine> chargeLines) {
        this.chargeLines = chargeLines;
    }

    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public String getSalesChannel() {
        return salesChannel;
    }

    public void setSalesChannel(String salesChannel) {
        this.salesChannel = salesChannel;
    }

    public String getTermsAndConditions() {
        return termsAndConditions;
    }

    public void setTermsAndConditions(String termsAndConditions) {
        this.termsAndConditions = termsAndConditions;
    }

    public int getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getDeliveryInstructions() {
        return deliveryInstructions;
    }

    public void setDeliveryInstructions(String deliveryInstructions) {
        this.deliveryInstructions = deliveryInstructions;
    }

    public Set<OrderEvent> getEvents() {
        return events;
    }

    public void setEvents(Set<OrderEvent> events) {
        this.events = events;
    }

    public int getOrderType() {
        return orderType;
    }

    public void setOrderType(int orderType) {
        this.orderType = orderType;
    }

    public class type {
        public static final int SALESORDER = 201;
        public static final int PURCHASEORDER = 202;
        public static final int TRANSFERORDER = 203;
    }

    public class role {
        public static final int VENDOR = 100;
        public static final int SALESAGENT = 101;
        public static final int PAYMENTRECEIVER = 102;
        public static final int ORDERINITIATOR = 103;
        public static final int PURCHASER = 104;
        public static final int ORDERRECEIVER = 105;
        public static final int ORDERLINERECEIVER = 106;
    }
}
